<?php
class Photo extends CI_Model {
	function __construct() {
		parent::__construct ();
	}
	function getPhotoPath($id) {
		$this->db->select ( "path" );
		$this->db->from ( "photo" );
		$this->db->where ( "id_Obj", $id );
		$query = $this->db->get ();
		if ($query->num_rows () >= 1) {
			return $query->result ();
		} else
			return FALSE;
	
	}
	function addPhoto($id_User, $id_Obj, $path ) {
		$data = array ('id_User' => $id_User ,'id_Obj'=> $id_Obj, 'path' => $path );
		
		$this->db->insert ( 'photo', $data );
		return $this->db->insert_id ();
		
	}
	
}